import request from '/@/utils/request';

// 菜单列表
export function MenuGetPagedList(params?: object) {
	return request({
		url: '/api/Menu/GetPagedList',
		params,
	});
}

// 新增菜单
export function MenuCreateMenu(data: any) {
	return request({
		url: 'api/Menu/CreateMenu',
		method: 'post',
		data,
	});
}

// 编辑菜单
export function MenuUpdate(data: any, id: string) {
	return request({
		url: `api/Menu/UpdateMenu/${id}`,
		method: 'put',
		data,
	});
}

// 删除菜单
export function MenuDeleteMenu(id: string) {
	return request({
		url: `api/Menu/DeleteMenu/${id}`,
		method: 'delete',
	});
}

// 新增按钮
export function CreateButton(data: any) {
	return request({
		url: 'api/Menu/CreateButton',
		method: 'post',
		data,
	});
}

// 编辑按钮
export function UpdateButton(data: any, id: string) {
	return request({
		url: `api/Menu/UpdateButton/${id}`,

		method: 'put',
		data,
	});
}
// 删除按钮
export function DeleteButton(id: string) {
	return request({
		url: `api/Menu/DeleteButton/${id}`,
		method: 'delete',
	});
}

// 权限菜单
export function GetLeftMenuTree() {
	return request({
		url: 'api/Menu/GetLeftMenuTree',
	});
}

// 权限菜单按钮
export function GetUserLeftMenuTreeAndBtns() {
	return request({
		url: 'api/Menu/GetUserLeftMenuTreeAndBtns',
	});
}
